import java.util.Scanner;
public class three {
    public static void main(String[] args) {
        int num=5000;
        double sum=0;
        double jiu=0.9;
        double ba =0.8;
        double qi =0.7;
        double wu =0.5;
        double si=0.4;
        double san =0.3;
        Scanner input=new Scanner(System.in);
        System.out.print("请输入出行的月份");
        int month=input.nextInt();
        String shipping;
        String ciyue;
        if (4<=month && month<=10){
            System.out.println("请您输入舱位");
             shipping=input.next();
            if ("头等舱".equals(shipping)){
                sum=num*jiu;
            }else if ("商务舱".equals(shipping)){
                sum=num*ba;
            }
            else if ("经济舱".equals(shipping)){
                sum=num*qi;
            }
            else {
                System.out.println("您输入错误");
            }System.out.println(sum);
        }
        else if (1<=month && month<=12){
            System.out.println("请您输入舱位");
        }
            ciyue=input.next();
            if ("头等舱".equals(ciyue)){
                sum=num*wu;
            }else if ("商务舱".equals(ciyue)){
                sum=num*si;
            }
            else if ("经济舱".equals(ciyue)){
                sum=num*san;
            }
            else {
                System.out.println("您输入错误");

        }
        System.out.println(sum);

    }}